import React from 'react';
import PropTypes from 'prop-types';
import { Router, hashHistory } from 'dva/router';
import App from './containers/App';

//--------------路径的Entry处理-------------------
const requireAuth = (nextState, replace) => {
  //******* 可以做一些条件判断处理，比如是否为管理员 然后可以跳转到相应的路径 *******
  const user = JSON.parse(sessionStorage.getItem('user'));
  // console.log(!user);
  if (!user) {
    // console.log(nextState);
    // console.log(nextState.location.pathname);
    // console.log('——————————————！');
    //如果不对登陆页面做排除的话，会产生无限循环，页面卡死
    if (nextState.location.pathname !== '/login') {
      // console.log('无Token，路由重新定向到登陆页面！')
      replace('/login');
    }
  }
};


const Routers = function ({ history, app }) {
  const routes = [{
    path: '/',
    component: App,
    onEnter: requireAuth,
    breadcrumbName: '首页',
    getIndexRoute(nextState, cb) {
      require.ensure([], require => {
        cb(null, {
          component: require('./components/Dashboard/index')
        })
      }, 'app')
    },
    childRoutes: [
      {
        path: 'orderinfo',
        breadcrumbName: '订单列表',
        getIndexRoute(nextState, cb) {
          require.ensure([], require => {
            cb(null, {
              component: require('./components/CustomService/OrderInfo/OrderInfo')
            })
          }, 'orderinfo')
        },
        childRoutes: [{
          path: 'orderinfo',
          breadcrumbName: '订单列表',
          getComponent(nextState, cb) {
            require.ensure([], require => {
              cb(null, require('./components/CustomService/OrderInfo/OrderInfo'))
            }, 'orderinfo')
          }
        },
        {
          path: 'CreateRefund_Qcp',
          breadcrumbName: '申请退款',
          getComponent(nextState, cb) {
            require.ensure([], require => {
              cb(null, require('./components/CustomService/CreateRefund_Qcp/CreateRefund_Qcp'))
            }, 'CreateRefund_Qcp')
          },
        },
        ]
      },
      {
        path: 'company',
        breadcrumbName: '单位管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/System/Company'))
          }, 'company')
        },
      },
      {
        path: 'configuration',
        breadcrumbName: '系统配置',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/System/Configuration'))
          }, 'configuration')
        },
      },
      {
        path: 'user',
        breadcrumbName: '用户管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/System/User'))
          }, 'user')
        },
      },
      {
        path: 'role',
        breadcrumbName: '角色管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/System/Role'))
          }, 'role')
        },
      }, {
        path: 'insurancetype',
        breadcrumbName: '保险类型',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Insurance/InsuranceType'))
          }, 'insurancetype')
        },
      }, {
        path: 'insuranceorder',
        breadcrumbName: '保单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Insurance/InsuranceOrder'))
          }, 'insuranceorder')
        },
      }, {
        path: 'insuranceorderlist',
        breadcrumbName: '保单详情',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Insurance/InsuranceOrderList'))
          }, 'insuranceorderlist')
        },
      },
      {
        path: 'dailyreport',
        breadcrumbName: '每日报表',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UserService/DailyReport'))
          }, 'dailyreport')
        },
      },
      {
        path: 'AllInfo',
        breadcrumbName: '车站详情',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/AllInfo.jsx'))
          }, 'AllInfo')
        },
      },
      {
        path: 'notewarn',
        breadcrumbName: '短信提醒',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UserService/UserManagement/NoteWarn'))
          }, 'notewarn')
        },
      },
      {
        path: 'problemsummary',
        breadcrumbName: '问题总结',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UserService/ProblemSummary'))
          }, 'problemsummary')
        },
      },
      {
        path: 'passwordreset',
        breadcrumbName: '密码重置',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UserService/UserManagement/PasswordReset'))
          }, 'passwordreset')
        },
      },
      {
        path: 'refund',
        breadcrumbName: '我的退款',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UserService/UserManagement/Refund'))
          }, 'refund')
        },
      },
      // {
      //   path: 'stationquery',
      //   breadcrumbName: '车站查询',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/UserService/UserManagement/StationQuery'))
      //     }, 'stationquery')
      //   },
      // },
      {
        path: 'suggestion',
        breadcrumbName: '投诉建议',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UserService/UserManagement/Suggestion'))
          }, 'suggestion')
        },
      },
      {
        path: 'refundmanage',
        breadcrumbName: '退款管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Financial/RefundManage'))
          }, 'refundmanage')
        },
      },
      {
        path: 'billDownload',
        breadcrumbName: '账单下载',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Financial/BillDownload'))
          }, 'billDownload')
        },
      },
      {
        path: 'bill',
        breadcrumbName: '账单对账',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Financial/Bill'))
          }, 'bill')
        },
      },
      {
        path: 'thirdrefund',
        breadcrumbName: '第三方退款',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Financial/ThirdRefund'))
          }, 'thirdrefund')
        },
      },
      {
        path: 'customrent',
        breadcrumbName: '定制约租退款',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Financial/CustomRent'))
          }, 'customrent')
        },
      },
      {
        path: 'customOrder',
        breadcrumbName: '定制客运订单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/CustomLine/CustomOrder.jsx'))
          }, 'customOrder')
        },
      },
      {
        path: 'customLineInfo',
        breadcrumbName: '定制客运线路管理',
        getIndexRoute(nextState, cb) {
          require.ensure([], require => {
            cb(null, {
              component: require('./components/BusStation/CustomLine/CustomLineInfo.jsx')
            })
          }, 'customLineInfo')
        },
        childRoutes: [
          {
            path: 'customLineInfo',
            breadcrumbName: '定制客运线路',
            getComponent(nextState, cb) {
              require.ensure([], require => {
                cb(null, require('./components/BusStation/CustomLine/CustomLineInfo.jsx'))
              }, 'customLineInfo')
            },
          },
          {
            path: 'customTakePoint',
            breadcrumbName: '定制客运乘车点',
            getComponent(nextState, cb) {
              require.ensure([], require => {
                cb(null, require('./components/BusStation/CustomLine/CustomLineTakePoint.jsx'))
              }, 'customTakePoint')
            },
          },
          {
            path: 'customBusLineStartTime',
            breadcrumbName: '定制客运发车配置',
            getComponent(nextState, cb) {
              require.ensure([], require => {
                cb(null, require('./components/BusStation/CustomLine/CustomBusLineStartTime.jsx'))
              }, 'customBusLineStartTime')
            },
          },
        ]
      },
      {
        path: 'customBusPlan',
        breadcrumbName: '定制客运当前运行班次',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/CustomLine/CustomBusPlan.jsx'))
          }, 'customBusPlan')
        },
      },
      {
        path: 'customRefund',
        breadcrumbName: '定制客运退款记录',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/CustomLine/CustomRefund.jsx'))
          }, 'customRefund')
        },
      },
      {
        path: 'customChecked',
        breadcrumbName: '定制客运检票记录',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/CustomLine/CustomChecked.jsx'))
          }, 'customChecked')
        },
      },
      {
        path: 'customApplyRefund',
        breadcrumbName: '定制客运申请退款',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/CustomLine/CustomApplyRefund.jsx'))
          }, 'customChecked')
        },
      },
      {
        path: 'busticket',
        breadcrumbName: '汽车票订单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/BusTickets/BusTicket'))
          }, 'busticket')
        },
      },
      {
        path: 'buslineqrcode',
        breadcrumbName: '线路二维码',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/BusTickets/BusLineQrCode'))
          }, 'buslineqrcode')
        },
      },
      {
        path: 'busstationrefund',
        breadcrumbName: '汽车票退款',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/BusTickets/BusStationRefund'))
          }, 'busstationrefund')
        },
      },
      {
        path: 'stationInfo',
        breadcrumbName: '汽车站信息',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/StationInfo'))
          }, 'stationInfo')
        },
      },
      {
        path: 'customCarInfo',
        breadcrumbName: '车辆管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BasicInfo/CustomCarInfo'))
          }, 'customCarInfo')
        },
      },
      {
        path: 'customDriverInfo',
        breadcrumbName: '司机管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BasicInfo/CustomDriverInfo'))
          }, 'customDriverInfo')
        },
      },
      // {
      //   path: 'customline',
      //   breadcrumbName: '定制客运',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/BusStation/CustomLine'))
      //     }, 'customline')
      //   },
      // },
      {
        path: 'rentOrder',
        breadcrumbName: '城际约租订单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentOrder'))
          }, 'rentOrder')
        },
      },
      {
        path: 'rentPath',
        breadcrumbName: '城际约租路线管理',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentPath'))
          }, 'rentPath')
        },
      },
      {
        path: 'rentBill',
        breadcrumbName: '城际约租电话录单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentBill'))
          }, 'rentBill')
        },
      },
      {
        path: 'rentRefund',
        breadcrumbName: '城际约租退款信息',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentRefund'))
          }, 'rentRefund')
        },
      },
      {
        path: 'rentStartOrder',
        breadcrumbName: '城际约租派车单列表',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentStartOrder'))
          }, 'rentStartOrder')
        },
      },

      {
        path: 'rentStart',
        breadcrumbName: '城际约租派车',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentStart'))
          }, 'rentStart')
        },
      },

      {
        path: 'rentTable',
        breadcrumbName: '约租车统计报表',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/BusStation/RentAdmin/RentTable'))
          }, 'rentTable')
        },
      },
      // {
      //   path: 'linemanage',
      //   breadcrumbName: '线路管理',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/TouristStation/LineManage'))
      //     }, 'linemanage')
      //   },
      // },
      // {
      //   path: 'orderquery',
      //   breadcrumbName: '订单查询',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/TouristStation/OrderQuery'))
      //     }, 'orderquery')
      //   },
      // },
      // {
      //   path: 'linestatistic',
      //   breadcrumbName: '线路统计',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/TouristStation/LineStatistic'))
      //     }, 'linestatistic')
      //   },
      // },
      // {
      //   path: 'marketactive',
      //   breadcrumbName: '营销活动管理',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/TouristStation/MarketActive'))
      //     }, 'marketactive')
      //   },
      // },
      {
        path: 'activitys',
        breadcrumbName: '优惠活动',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/MarketManage/Activitys'))
          }, 'activitys')
        },
      },
      {
        path: 'activityrecords',
        breadcrumbName: '优惠活动记录',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/MarketManage/ActivityRecords'))
          }, 'activityrecords')
        },
      },
      // {
      //   path: 'promoter',
      //   breadcrumbName: '推广人',
      //   getComponent(nextState, cb) {
      //     require.ensure([], require => {
      //       cb(null, require('./components/MarketManage/Promoter'))
      //     }, 'promoter')
      //   },
      // },
      {
        path: 'erweima',
        breadcrumbName: '推广二维码',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/MarketManage/Erweima'))
          }, 'erweima')
        },
      },
      {
        path: 'extension',
        breadcrumbName: '推广统计',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/MarketManage/Extension'))
          }, 'extension')
        },
      },
      {
        path: 'loginstatistic',
        breadcrumbName: '登录统计',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/MarketManage/LoginStatistic'))
          }, 'loginstatistic')
        },
      },
      {
        path: 'shiftupdate',
        breadcrumbName: '班次更新',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/ShiftUpdate/ShiftUpdate'))
          }, 'shiftupdate')
        },
      },
      {
        path: 'machinerror',
        breadcrumbName: '自助机错误',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/ShiftUpdate/MachinError'))
          }, 'machinerror')
        },
      },
      {
        path: 'numbershift',
        breadcrumbName: '班次更新天数',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/ShiftUpdate/NumberShift'))
          }, 'numbershift')
        },
      },
      {
        path: 'applog',
        breadcrumbName: 'APP登陆日志',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/AppService/AppLog'))
          }, 'applog')
        },
      },
      {
        path: 'appoperation',
        breadcrumbName: 'APP运行日志',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/AppService/AppOperation'))
          }, 'appoperation')
        },
      },
      {
        path: 'smslog',
        breadcrumbName: '短信日志',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/SMService/SmsLog'))
          }, 'smslog')
        }
      },
      {
        path: 'machinedetail',
        breadcrumbName: '自助机详情',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/MachineDetail'))
          }, 'machinedetail')
        },
      },
      {
        path: 'notorder',
        breadcrumbName: '未撤销订单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/NotOrder'))
          }, 'notorder')
        },
      },
      {
        path: 'balancealarm',
        breadcrumbName: '余额报警',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/BalanceAlarm'))
          }, 'balancealarm')
        },
      },
      {
        path: 'chargerecord',
        breadcrumbName: '充值记录',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/chargeRecord'))
          }, 'chargerecord')
        },
      },
      {
        path: 'breakstation',
        breadcrumbName: '断网车站',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/BreakStation'))
          }, 'breakstation')
        },
      },
      {
        path: 'updateLog',
        breadcrumbName: '更新日志',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/UpdateLog'))
          }, 'updateLog')
        },
      },
      {
        path: 'stationContact',
        breadcrumbName: '车站联系人',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Operation/StationContact'))
          }, 'stationContact')
        },
      },
      {
        path: 'billstate',
        breadcrumbName: '账单报表',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Report/BillState'))
          }, 'billstate')
        },
      },
      {
        path: 'shiftquery',
        breadcrumbName: '班次查询',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Report/ShiftQuery'))
          }, 'shiftquery')
        },
      },
      {
        path: 'generatecode',
        breadcrumbName: '生成二维码',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Report/GenerateCode'))
          }, 'generatecode')
        },
      },
      {
        path: 'record',
        breadcrumbName: '活动记录',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Report/Record'))
          }, 'record')
        },
      },
      {
        path: 'ticket',
        breadcrumbName: '售票统计',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Ticket/Ticket'))
          }, 'ticket')
        },
      },
      {
        path: 'dashboard1',
        breadcrumbName: '仪表盘1',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Dashboard/Dashboard1'))
          }, 'dashboard1')
        },
      }, {
        path: 'dashboard2',
        breadcrumbName: '仪表盘2',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Dashboard/Dashboard2'))
          }, 'dashboard2')
        },
      }, {
        path: 'mail',
        breadcrumbName: '邮箱',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Mail/Mail'))
          }, 'mail')
        },
      }, {
        path: 'profile',
        breadcrumbName: '资料',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Pages/Profile'))
          }, 'profile')
        },
      }, {
        path: 'affix',
        breadcrumbName: '固钉',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Navigation/Affix'))
          }, 'affix')
        },
      }, {
        path: 'pagination',
        breadcrumbName: '分页',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Navigation/Pagination'))
          }, 'pagination')
        },
      }, {
        path: 'breadcrumb',
        breadcrumbName: '面包屑',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Navigation/Breadcrumb'))
          }, 'breadcrumb')
        },
      }, {
        path: 'steps',
        breadcrumbName: '步骤条',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Navigation/Steps'))
          }, 'steps')
        },
      }, {
        path: 'avatar',
        breadcrumbName: '头像',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Avatar'))
          }, 'avatar')
        },
      }, {
        path: 'button',
        breadcrumbName: '按钮',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Button'))
          }, 'button')
        },
      }, {
        path: 'icon',
        breadcrumbName: '图标',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Icon'))
          }, 'icon')
        },
      }, {
        path: 'tag',
        breadcrumbName: '标签',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Tag'))
          }, 'tag')
        },
      }, {
        path: 'switch',
        breadcrumbName: '开关',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Switch'))
          }, 'switch')
        },
      }, {
        path: 'calendar',
        breadcrumbName: '日历',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Calendar'))
          }, 'calendar')
        },
      }, {
        path: 'checkbox',
        breadcrumbName: '多选框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Checkbox'))
          }, 'checkbox')
        },
      }, {
        path: 'radio',
        breadcrumbName: '单选框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Radio'))
          }, 'radio')
        },
      }, {
        path: 'input',
        breadcrumbName: '输入框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Input'))
          }, 'input')
        },
      }, {
        path: 'timeline',
        breadcrumbName: '时间轴',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Timeline'))
          }, 'timeline')
        },
      }, {
        path: 'badge',
        breadcrumbName: '徽标数',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Badge'))
          }, 'badge')
        },
      }, {
        path: 'slider',
        breadcrumbName: '滑动输入条',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/UI/Slider'))
          }, 'slider')
        },
      }, {
        path: 'popconfirm',
        breadcrumbName: '气泡确认框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Popconfirm'))
          }, 'popconfirm')
        },
      }, {
        path: 'popover',
        breadcrumbName: '气泡卡片',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Popover'))
          }, 'popover')
        },
      }, {
        path: 'notification',
        breadcrumbName: '气泡确认框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Notification'))
          }, 'notification')
        },
      }, {
        path: 'message',
        breadcrumbName: '全局提示',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Message'))
          }, 'message')
        },
      }, {
        path: 'alert',
        breadcrumbName: '警告提示',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Alert'))
          }, 'alert')
        },
      }, {
        path: 'tooltip',
        breadcrumbName: '文字提示',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Tooltip'))
          }, 'tooltip')
        },
      }, {
        path: 'collapse',
        breadcrumbName: '折叠面板',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Collapse'))
          }, 'collapse')
        },
      }, {
        path: 'tree',
        breadcrumbName: '树形控件',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Tree'))
          }, 'tree')
        },
      }, {
        path: 'treeselect',
        breadcrumbName: '树选择',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/TreeSelect'))
          }, 'treeselect')
        },
      }, {
        path: 'modal',
        breadcrumbName: '对话框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Modal'))
          }, 'modal')
        },
      }, {
        path: 'tabs',
        breadcrumbName: '标签页',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Tabs'))
          }, 'tabs')
        },
      }, {
        path: 'carousel',
        breadcrumbName: '走马灯',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Carousel'))
          }, 'carousel')
        },
      }, {
        path: 'progress',
        breadcrumbName: '进度条',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Display/Progress'))
          }, 'progress')
        },
      }, {
        path: 'mention',
        breadcrumbName: '提及',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/Mention'))
          }, 'mention')
        },
      }, {
        path: 'rate',
        breadcrumbName: '评分',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/Rate'))
          }, 'rate')
        },
      }, {
        path: 'select',
        breadcrumbName: '选择器',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/Select'))
          }, 'select')
        },
      }, {
        path: 'transfer',
        breadcrumbName: '穿梭框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/Transfer'))
          }, 'transfer')
        },
      }, {
        path: 'dropdown',
        breadcrumbName: '下拉菜单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/Dropdown'))
          }, 'dropdown')
        },
      }, {
        path: 'autocomplete',
        breadcrumbName: '自动完成',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/AutoComplete'))
          }, 'autocomplete')
        },
      }, {
        path: 'cascader',
        breadcrumbName: '级联选择',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/Cascader'))
          }, 'cascader')
        },
      }, {
        path: 'datepicker',
        breadcrumbName: '日期选择框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/DatePicker'))
          }, 'datepicker')
        },
      }, {
        path: 'timepicker',
        breadcrumbName: '时间选择框',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Entry/TimePicker'))
          }, 'timepicker')
        },
      }, {
        path: 'baseform',
        breadcrumbName: '基本表单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Form/BaseForm'))
          }, 'baseform')
        },
      }, {
        path: 'advancedform',
        breadcrumbName: '高级表单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Form/AdvancedForm'))
          }, 'advancedform')
        },
      }, {
        path: 'advancedsearch',
        breadcrumbName: '自定义搜索',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Form/AdvancedSearch'))
          }, 'advancedsearch')
        },
      }, {
        path: 'basetable',
        breadcrumbName: '基本表格',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Table/BaseTable'))
          }, 'basetable')
        },
      }, {
        path: 'advanced',
        breadcrumbName: '高级表格',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Table/Advanced'))
          }, 'advanced')
        },
      }, {
        path: 'playground',
        breadcrumbName: '动态表格',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Table/Playground'))
          }, 'playground')
        },
      }, {
        path: 'custable',
        breadcrumbName: '自定义表格',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Table/CusTable'))
          }, 'custable')
        },
      }, {
        path: 'grid',
        breadcrumbName: '格栅',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Layout/Grid'))
          }, 'grid')
        },
      }, {
        path: 'gridplayground',
        breadcrumbName: '格栅配置器',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Layout/GridPlayground'))
          }, 'gridplayground')
        },
      }, {
        path: 'layout',
        breadcrumbName: '布局',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Layout/Layout'))
          }, 'layout')
        },
      }, {
        path: 'card',
        breadcrumbName: '卡片',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Layout/Card'))
          }, 'card')
        },
      }, {
        path: 'menu',
        breadcrumbName: '菜单',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Layout/Menu'))
          }, 'menu')
        },
      }, {
        path: 'logogather',
        breadcrumbName: 'Logo动画',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/LogoGather'))
          }, 'logogather')
        },
      }, {
        path: 'tableanim',
        breadcrumbName: '表格增删',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/TableAnim'))
          }, 'tableanim')
        },
      }, {
        path: 'listanim',
        breadcrumbName: '列表动画',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/ListAnim'))
          }, 'listanim')
        },
      }, {
        path: 'detailswitch',
        breadcrumbName: '详细说明切换',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/DetailSwitch'))
          }, 'detailswitch')
        },
      }, {
        path: 'listsort',
        breadcrumbName: '列表交换位置',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/ListSort'))
          }, 'listsort')
        },
      }, {
        path: 'picanim',
        breadcrumbName: '图片详细切换',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/PicAnim'))
          }, 'picanim')
        },
      }, {
        path: 'banneranim',
        breadcrumbName: 'Banner',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/AntMotion/BannerAnim'))
          }, 'banneranim')
        },
      }, {
        path: 'about',
        breadcrumbName: '关于',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/About/About'))
          }, 'about')
        },
      }, {
        path: 'blank',
        breadcrumbName: '空白',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Pages/Blank'))
          }, 'blank')
        },
      }, {
        path: 'login',
        breadcrumbName: '登录',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Pages/Login'))
          }, 'Login')
        },
      }, {
        path: 'signup',
        breadcrumbName: '注册',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Pages/Signup'))
          }, 'Signup')
        },
      }, {
        path: 'lock',
        breadcrumbName: '锁定',
        getComponent(nextState, cb) {
          require.ensure([], require => {
            cb(null, require('./components/Pages/Lock'))
          }, 'Lock')
        },
      }]
  }]

  return <Router history={hashHistory} routes={routes} />
}

Routers.propTypes = {
  history: PropTypes.object,
  app: PropTypes.object,
}

export default Routers
